﻿using UnityEngine;
public class BasePanel:MonoBehaviour
{
    [Header("界面")]
    public GameObject item;
    [Header("路径")]
    public string path;
    [Header("类型")]
    public PanelType type;

    public void Init()
    {
        //实例化界面
        item=Instantiate(ResManager.LoadObj(path));
    }
    public virtual void OnInit()
    {

    }
    public virtual void OnShow(params object[] par)
    {

    }
    public void Close()
    {
        //获取自己的名称
        string myName = this.GetType().Name;
        //关闭
        PanelManager.Close(myName);
    }
    public virtual void OnClose()
    {

    }
}